﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace UDPAgency
{
    internal class UDPAgenncyOption
    {

        private int _LosePacketCount = 0;

        /// <summary>
        /// 启用强制丢包
        /// </summary>
        public bool UserPacketLose { get; set; }

        /// <summary>
        /// 丢包率
        /// </summary>
        public int PacketLoseNum { get; set; }


        /// <summary>
        /// 丢包次数
        /// </summary>
        public int LosePacketCount { 
            get { return _LosePacketCount; } 
        }

        public void AddLosePacketCount()
        {
            Interlocked.Increment(ref _LosePacketCount);
        }

        public void ClearLosePacketCount()
        {
            Interlocked.Exchange(ref _LosePacketCount, 0);
        }
    }
}
